<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/connopen.asp"-->
<!--#include file="lib/asp-common-lib.asp"-->
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>报关单登记系统</title>
<!--#include file="lib/plugins.asp"-->
<style type="text/css">
	.ui-datepicker table {
		border: 0;
	}
	#tablelist{
		min-width:30%;
	}
</style>
<script type="text/javascript">
	$(function() {
        $("#form1").validationEngine('attach',{
            validationEventTrigger:'submit'
        });
	});
</script>	
<!--#include file="lib/js-google-analytics.asp"-->
</head>
<%
if not CheckPostFlag(session("aaPostFlag"),0,15) then call JumpErrorPage(2)
id=saferequest("id",1)
if id="" then id=0 else id=clng(id)
submit=saferequest("submit",0)
if id<>0 then
	sql = "select * from bwtr where id="&id
	Set rs = Server.CreateObject("ADODB.Recordset")
	rs.Open sql,conn,1,1
	if not rs.eof then
		bwtr=rs("bwtr")
		uid=rs("uid")
		pwd=rs("pwd")
	end if
	rs.close
	set rs=nothing
end if
if submit<>"" then
	bwtr=saferequest("bwtr",0)
	uid=saferequest("uid",0)
	pwd=saferequest("pwd",0)
	if submit="新增" then
        sql="insert into bwtr(bwtr,uid,pwd) values('"&bwtr&"','"&uid&"','"&pwd&"')"
        id=ExecuteCommand(sql,true)
        response.redirect("bwtr.asp?id="&clng(id))
    end if
	if submit="保存" then
        sql="update bwtr set bwtr='"&bwtr&"',uid='"&uid&"',pwd='"&pwd&"' where id="&id
        call ExecuteCommand(sql,false)
    end if
end if
%>

<body>
<!--#include file="lib/header.asp"-->
<!--#include file="lib/nav.asp"-->
<div id="main">
<!--#include file="lib/col1.asp"-->
<!--#include file="lib/col2.asp"-->
	<div id="col3" role="main">
		<div id="col3_content" class="clearfix">
			<form id="form1" name="form1" method="post" class="yform" role="application">
				<div class="type-text">
					<label for="bwtr">被委托人*</label>
					<input name="bwtr" id="bwtr" type="text" size="10" class="validate[required]" value="<%=bwtr%>" />
				</div>
				<div class="type-text">
					<label for="uid">UID*</label>
					<input name="uid" id="uid" type="text" size="10"  value="<%=uid%>" />
				</div>
				<div class="type-text">
					<label for="pwd">PWD*</label>
					<input name="pwd" id="pwd" type="password" size="10"  value="<%=pwd%>" />
				</div>
				<div class="type-button">
				<%
					if id<>0 then
				%>
					<input type="submit" name="submit" class="submit" value="保存" />
				<%
					else
				%>
					<input type="submit" name="submit" class="submit" value="新增" />
				<%
					end if
				%>
				</div>
			</form>
			<table id="tablelist">
				<thead>
					<tr><th colspan="3" scope="col">被委托人明细</th></tr>
				</thead>
				<tbody>
					<tr>
						<th scope="col">ID</th>
						<th scope="col">被委托人</th>
						<th scope="col">UID</th>
					</tr>
					<%
						sql = "select * from bwtr order by bwtr"
						Set rs = Server.CreateObject("ADODB.Recordset")
						rs.Open sql,conn,1,1
						do while not rs.eof
					%>
					<tr>
						<th class="sub" scope="row"><%=rs.AbsolutePosition%></th>
						<td><a href="bwtr.asp?id=<%=rs("id")%>"><%=rs("bwtr")%></a></td>
						<td><%=rs("uid")%></td>
					</tr>
					<%
						
							rs.movenext
						loop
						rs.close
						set rs=nothing
					
					%>
					
				</tbody>
			</table>
		</div>
	</div>
</div>
<!--#include file="lib/footer.asp"-->
</body>
</html>
<!--#include file="lib/connclose.asp"-->

